<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Flat UI Free</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Loading Bootstrap -->
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">

    <!-- Loading Flat UI -->
    <link href="css/flat-ui.css" rel="stylesheet">

    <link rel="shortcut icon" href="images/favicon.ico">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">
         <h1 class="demo-section-title mbl pbl">Samples</h1>
      
    

<div id="zzhtable">
<button  type="button" class="btn btn-info" id="AddSubcount_Btn">添加子账号</button>
<button  type="button" class="btn btn-info" id="AddSubcount_test_Btn">测试</button>
<button  type="button" class="btn btn-info" id="AddSubcount_time_test_Btn">时间测试</button>
<span id="timeshow"></span>
</div>
<form id="form2" method="post" enctype="multipart/form-data"> 
   <input id="fileupload" name="file" type="file" /> 
   <div id="message"></div>   
   <input type="button" class="right-button02 btn btn-info" onclick="uploadImage()" value="上传" /> 

</form> 
   图片预览 <div ><img src="" id="showImage" width='90' height='110'></div>
 <div class="row" >
        <div class="col-md-12">
          <table width="20%" class="table" id="datas">
            <thead>
             <tr>
         <th width="12%" style="text-align:center">子账号编号</th>
                <th width="12%" style="text-align:center">子账号类型</th>
                <th width="15%" style="text-align:center">子账号</th>
                <th width="17%" style="text-align:center">子账号密码</th>
                <th width="18%" style="text-align:center">启用状态</th>
         <th width="26%" style="text-align:center">操作</th>
              </tr>
            </thead>
            <tbody style="width:900px;">
              <tr id="child_Account_table_template">
        		<td style="text-align:center" id="child_Account_table_nAccountId"></td>
                <td style="text-align:center" id="child_Account_table_naccountType"></td>
                <td style="text-align:center" id="child_Account_table_strName"></td>
                <td style="text-align:center" id="child_Account_table_strPasswd"></td>
                <td style="text-align:center" id="child_Account_table_bInUse"></td>
         		<td align="center" id="child_Account_table_operate"></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    
    </div>


    
     <!-- Modal子账号编辑 -->
<div class="modal fade" id="myModal1zzhbj" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;" >
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="false"></span><span class="sr-only">Close</span></button>
        <h5 class="modal-title" id="myModalLabel">设置前台账号是否允许绑定的IP登录</h5>
      </div>
      <div class="modal-body">
             <div class="control-group">
            <div class="col-sm-5" align="right">
                 <h7 >子账号：</h7>
            </div>
             <div class="col-sm-7" align="left">
                  13247107171
             </div>
        </div>
                <div class="control-group">
                  <div class="row">
                  <div class="col-sm-5" align="right">
               <h7 >启用状态：</h7>
               </div>
             <div class="col-sm-7" align="left">
                <input type="checkbox" checked data-toggle="switch" />
            </div>
            </div>
        </div>
        <div class="control-group">
            <div class="col-sm-5" align="right">
                 <h7 >子账号类型：</h7>
            </div>
             <div class="col-sm-7" align="left">
                <select name="herolist" value="服饰" class="select-block">
                  <option value="0">美食</option>
                  <option value="1">酒店</option>
                  <option value="2">机票</option>
                  <option value="3">旅游</option>
                  <option value="4">娱乐</option>
                </select>
             </div>
        </div>
        <br>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary">保存</button>
      </div>
    </div>
  </div>
</div>
<br>
<!--modal子账号表编辑 End-->

<form class="form-horizontal" id="vip_details_checkin_form" action="merchant_updateMerchantDetail.action">
			  <h6 class="demo-panel-title" ><b>会员信息添加</b></h6>
			  <div class="control-group" >
						 <div class="row">
								<div class="col-sm-4" align="right">
									<label >会员姓名：</label>
								</div>
								<div class="col-sm-5" >
									  <input placeholder="会员姓名" id="vipinfoname" class="form-control" type="text" style="width:300px">
									  <input type="file" name="file" id="file">upload</input>
								</div>
								<button type="submit">提交</button>
                <div class="col-sm-3"  id="hidevipinfoname" align="left" style="color:#FF3366">
               </div>
						 </div>
			 </div>
			 </form>
    </div>
    <!-- /.container -->
	


    <!-- Load JS here for greater good =============================-->
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="js/jquery.ui.touch-punch.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-select.js"></script>
    <script src="js/bootstrap-switch.js"></script>
    <script src="js/flatui-checkbox.js"></script>
    <script src="js/flatui-radio.js"></script>
    <script src="js/jquery.tagsinput.js"></script>
    <script src="js/jquery.placeholder.js"></script>
    <script src="js/henryzhaojs/table.js"></script>
    <script src="js/henryzhaojs/jquery.form.js"></script>
    <script type="text/javascript">
    $("#AddSubcount_time_test_Btn").click(function(){
    $.ajax({
        type: "get",//使用get方法访问后台
        dataType: "json",//返回json格式的数据
        url: "card_listUnusedCard.action?merchantId=1234567&pageNo=1&pageSize=10",//要访问的后台地址
        data: "",
        complete :function(){},//AJAX请求完成时隐藏loading提示
        success: function(msg){        //msg为返回的数据，在这里做数据绑定
          if (msg == "" || msg == null) {
        alert("error!");
      } else {
        $.each(msg, function(i, n){
             var time=n.dtCardMakeTime.date;
             $("#timeshow").text(time);

        });
                  
        }
    },
        error: function(xhr, textStatus, errorThrown) {
      //NotifyTryAgain();
    }
    });

    });
     
     $("#fileupload").change(function(){
        var objUrl = getObjectURL(this.files[0]) ;
         console.log("objUrl = "+objUrl) ;
          if (objUrl) {
           $("#showImage").attr("src", objUrl) ;
  }
}) ;
function getObjectURL(file) {
  var url = null ; 
  if (window.createObjectURL!=undefined) { // basic
    url = window.createObjectURL(file) ;
  } else if (window.URL!=undefined) { // mozilla(firefox)
    url = window.URL.createObjectURL(file) ;
  } else if (window.webkitURL!=undefined) { // webkit or chrome
    url = window.webkitURL.createObjectURL(file) ;
  }
  return url ;
}
    function uploadImage() { 
    
      $(document).ready(function() {
        var options = { 
        url : "merchant_updateMerchantDetail.action?detail.nrecordId=8",//跳转到相应的Action 
        type : "get",//提交方式 
        dataType : "script",//数据类型 
        success : function(msg) {//调用Action后返回过来的数据 
                 alert(msg); 
                 if (msg.indexOf("#") > 0) { 
                  } else { 
                    $("#message").html(msg);//在相应的位置显示信息 
                    } 
                } 
          }; 
        $("#form2").ajaxSubmit(options);//绑定页面中form表单的id 
                       return false; 
      }); 
  }  
    </script>
  </body>
</html>